Repository navigation
test(engine): preserve files written by past releases - #2103
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| serde_json::to_value(&places.dataset.features).unwrap(), | ||
| json!([ | ||
| {"id": 1, "geometry": {"Point": {"x": 1.0, "y": 2.0}}, "attrs": [{"Text": "Alpha"}, {"Int": 10}]}, | ||
| {"id": 2, "geometry": {"Point": {"x": 3.0, "y": 4.0}}, "attrs": [{"Text": "Béta"}, {"Int": 20}]} |
There was a problem hiding this comment.
Quality (test coverage), medium confidence. The version list is hard-coded, so a release whose v*.rgis / v*.prefs.json files are added to testdata/releases without extending this list passes silently. Only deletions fail (via unwrap). The docs make adding files a manual step, so the test should check the directory itself. Suggested change: list the fixtures on disk and require the list to match, so a new file fails until the test is extended.
| {"id": 2, "geometry": {"Point": {"x": 3.0, "y": 4.0}}, "attrs": [{"Text": "Béta"}, {"Int": 20}]} | |
| let fixtures = Path::new(env!("CARGO_MANIFEST_DIR")).join("testdata/releases"); | |
| let mut found: Vec<String> = std::fs::read_dir(&fixtures) | |
| .unwrap() | |
| .filter_map(|entry| entry.ok()?.file_name().into_string().ok()) | |
| .filter_map(|name| name.strip_suffix(".rgis").map(str::to_owned)) | |
| .collect(); | |
| found.sort(); | |
| assert_eq!(found, ["v0.2.0", "v0.3.0", "v0.4.0", "v0.5.0", "v0.6.0"]); |
Not a blocker. The same list should also be checked against the README table, but that is a nit for the release quality pass.
There was a problem hiding this comment.
Fair point. The list stays explicit for now; checking it against the files on disk is left for the release quality pass.
Code reviewBugs: None found on the changed lines. I checked the test's references against the source: Security: None. The change adds fixtures and a test, with no runtime input handling. Performance: None. Quality:
AGENTS.md: No violations found. The Earlier concerns: There are no prior review threads, so none were skipped. Change sizeCompared: the whole PR against main (merge base 5709134 to PR head 270fdde).
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Summary
Keep real projects and settings written by every tagged release from v0.2.0 through v0.6.0. This gives future reader changes a regression test against files existing users can already have, before #1853 starts writing project format 2.
project.openand each preferences file through the desktop preferences reader. It checks layer order and IDs, feature geometry and attributes, symbology, labels, definition-query results, transparency, camera and settings, and requires the exact successful-open notice.end-of-file-fixerexception for these ten files.Testing
released_projects_and_preferences_still_open: all five release pairs pass.cargo xtask changedpassed for the engine and its eight dependants (formatting, Clippy, tests and layers).RUSTFLAGS="-D warnings" cargo check -p rustgis-engine --target wasm32-unknown-unknownpassed.270fddebf3230860f1929bc4820921adf7d1ad1e.UI evidence
No visible UI change.
Related issue
Compatibility coverage for #1853 and #1405; complements the current-writer schema fixtures in #2065.
Summary by CodeRabbit
Tests
Documentation